@extends(config('admin.systems.layout_form_blade'))

@section('content')
    <div class="nav-tabs-custom">
        <ul class="nav nav-tabs">
            <li class=""><a href="javascript:void(0)" onclick="window.history.go(-1);">返回列表</a></li>
            <li class="active"><a href="#basic" data-toggle="tab" aria-expanded="true">基础</a></li>
            <li class=""><a href="#extend" data-toggle="tab" aria-expanded="false">扩展</a></li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="basic">
                <input type="hidden" name="document[id]" value="{{ get_value($detail, 'id', 0) }}">

                <div class="form-group">
                    <label for="input-title" class="col-sm-1 control-label">{{ $documentTypeTitle }}标题</label>

                    <div class="col-sm-9">
                        {!! get_input_html('document[title]', get_value($detail, 'title', ''), ['id'=>'input-title']) !!}
                    </div>
                </div>

                <div class="form-group">
                    <label for="input-category_id" class="col-sm-1 control-label">所属栏目</label>

                    <div class="col-sm-9">
                        <select name="document[category_id]" id="input-category_id" class="form-control" @if(get_value($detail, 'document_type', '') == 'page')  disabled @endif>
                            {!! get_select_tree($categoryList, get_value($detail, 'category_id', $categoryId), $categoryNotAllowIdList) !!}
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="input-description" class="col-sm-1 control-label">{{ $documentTypeTitle }}简介</label>

                    <div class="col-sm-9">
                        {!! get_textarea_html('document[description]', get_value($detail, 'description', ''), ['id'=>'input-description']) !!}
                    </div>
                </div>

                <div class="form-group">
                    <label for="input-cover" class="col-sm-1 control-label">封面图片</label>

                    <div class="col-sm-9">
                        {!! get_upload_picture_html('document[cover]', ['id'=>0, 'url'=>get_value($detail, 'cover', $defaultCover), 'desc'=>''], 1) !!}
                    </div>
                </div>

                <div class="form-group">
                    <label for="input-source_id" class="col-sm-1 control-label">{{ $documentTypeTitle }}来源</label>

                    <div class="col-sm-9">
                        {!! get_select_html($sourceList, 'document[source_id]', get_value($detail, 'source_id', ''), ['id'=>'input-source_id']) !!}
                    </div>
                </div>

                @if(get_value($detail, 'status', 0) == 0)
                <div class="form-group">
                    <label for="input-is_audit" class="col-sm-1 control-label">是否需要审核</label>
                    <div class="col-sm-9">
                        {!! get_radio_html(config('admin.systems.document_audit_list'), 'document[is_audit]', get_value($detail, 'is_audit', '0'), ['id'=>'input-is_audit']) !!}
                    </div>
                </div>
                @endif

                <div class="form-group">
                    <label for="input-click" class="col-sm-1 control-label">点击量</label>

                    <div class="col-sm-9">
                        {!! get_input_html('document[click]', get_value($detail, 'click', 0), ['id'=>'input-click', 'type'=>'number']) !!}
                    </div>
                </div>

                <div class="form-group">
                    <label for="input-fixed_release_time" class="col-sm-1 control-label">发布时间</label>

                    <div class="col-sm-9">
                        <input type="datetime" name="document[fixed_release_time]" value="{{ get_value($detail, 'fixed_release_time', date('Y-m-d H:i:s')) }}" class="form-control" id="input-fixed_release_time">
                    </div>
                </div>

                @if($posList)
                <div class="form-group">
                    <label for="input-position" class="col-sm-1 control-label">推荐</label>
                    <div class="col-sm-9">
                        {!! get_checkbox_html($posList, 'position[]', $posInputValue, ['id'=>'input-position']) !!}
                    </div>
                </div>
                @endif

                <!--<div class="form-group">
                    <label for="input-support" class="col-sm-1 control-label">点赞数</label>

                    <div class="col-sm-9">
                        {!! get_input_html('document[support]', get_value($detail, 'support', 0), ['id'=>'input-support', 'type'=>'number']) !!}
                    </div>
                </div>

                <div class="form-group">
                    <label for="input-comment" class="col-sm-1 control-label">评论数</label>

                    <div class="col-sm-9">
                        {!! get_input_html('document[comment]', get_value($detail, 'comment', 0), ['id'=>'input-comment', 'type'=>'number']) !!}
                    </div>
                </div>

                <div class="form-group">
                    <label for="input-collect" class="col-sm-1 control-label">收藏数</label>

                    <div class="col-sm-9">
                        {!! get_input_html('document[collect]', get_value($detail, 'collect', 0), ['id'=>'input-collect', 'type'=>'number']) !!}
                    </div>
                </div>-->

            </div>

            <div class="tab-pane" id="extend">

                @include('admin.portal.document.'.$documentType)

            </div>
        </div>
    </div>
@endsection

